package com.c2b.algorithm.leetcode.base;

/**
 * @author c2b
 * @since 2024/3/25 9:54
 */
public class LC0518 {

    static class Solution {
        public int change(int amount, int[] coins) {
            int[] dp = new int[amount + 1];
            dp[0] = 1;
            for (int coin : coins) {
                for (int i = coin; i <= amount; i++) {
                    dp[i] += dp[i - coin];
                }
            }
            return dp[amount];
        }
    }
}
